package top.dark.coupon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@EnableFeignClients(basePackages = "top.dark.coupon.entity")
@EnableDiscoveryClient
@SpringBootApplication
public class MallCouponApplication {

    public static void main(String[] args) throws InterruptedException {
        SpringApplication.run(MallCouponApplication.class, args);
        // 检验nacos配置中心是否配好
        /*ConfigurableApplicationContext applicationContext = SpringApplication.run(MallCouponApplication.class, args);
        while(true) {
            //当动态配置刷新时，会更新到 Enviroment中，因此这里每隔一秒中从Enviroment中获取配置
            String userName = applicationContext.getEnvironment().getProperty("value");
            System.err.println("value name :" + userName);
            TimeUnit.SECONDS.sleep(1);
        }*/
    }

}
